<?php

/**
 * DocLigneVersion filter form base class.
 *
 * @package    symfony
 * @subpackage filter
 * @author     Your name here
 * @version    SVN: $Id: sfDoctrineFormFilterGeneratedTemplate.php 29570 2010-05-21 14:49:47Z Kris.Wallsmith $
 */
abstract class BaseDocLigneVersionFormFilter extends BaseFormFilterDoctrine
{
  public function setup()
  {
    $this->setWidgets(array(
      'date'                   => new sfWidgetFormFilterDate(array('from_date' => new sfWidgetFormDate(), 'to_date' => new sfWidgetFormDate())),
      'designation'            => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'taux_remise'            => new sfWidgetFormFilterInput(),
      'quantite_livre'         => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'quantite'               => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'poids_net'              => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'poids_brut'             => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'prix_unitaire_h_t'      => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'prix_total_h_t'         => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'prix_total_t_t_c'       => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'prix_total_t_t_c_n_e_t' => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'prix_t_v_a'             => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'id_article'             => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('Article'), 'add_empty' => true)),
      'id_article_serie'       => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('ArticleSerie'), 'add_empty' => true)),
      'id_doc_entete'          => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('DocEnteteVersion'), 'add_empty' => true)),
      'id_t_v_a'               => new sfWidgetFormFilterInput(),
      'id_maintenance'         => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('Maintenance'), 'add_empty' => true)),
      'id_departement'         => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('Departement'), 'add_empty' => true)),
      'id_unite_logistique'    => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('UniteLogistique'), 'add_empty' => true)),
      'created_at'             => new sfWidgetFormFilterDate(array('from_date' => new sfWidgetFormDate(), 'to_date' => new sfWidgetFormDate(), 'with_empty' => false)),
      'updated_at'             => new sfWidgetFormFilterDate(array('from_date' => new sfWidgetFormDate(), 'to_date' => new sfWidgetFormDate(), 'with_empty' => false)),
    ));

    $this->setValidators(array(
      'date'                   => new sfValidatorDateRange(array('required' => false, 'from_date' => new sfValidatorDate(array('required' => false)), 'to_date' => new sfValidatorDateTime(array('required' => false)))),
      'designation'            => new sfValidatorPass(array('required' => false)),
      'taux_remise'            => new sfValidatorSchemaFilter('text', new sfValidatorNumber(array('required' => false))),
      'quantite_livre'         => new sfValidatorSchemaFilter('text', new sfValidatorNumber(array('required' => false))),
      'quantite'               => new sfValidatorSchemaFilter('text', new sfValidatorNumber(array('required' => false))),
      'poids_net'              => new sfValidatorSchemaFilter('text', new sfValidatorNumber(array('required' => false))),
      'poids_brut'             => new sfValidatorSchemaFilter('text', new sfValidatorNumber(array('required' => false))),
      'prix_unitaire_h_t'      => new sfValidatorSchemaFilter('text', new sfValidatorNumber(array('required' => false))),
      'prix_total_h_t'         => new sfValidatorSchemaFilter('text', new sfValidatorNumber(array('required' => false))),
      'prix_total_t_t_c'       => new sfValidatorSchemaFilter('text', new sfValidatorNumber(array('required' => false))),
      'prix_total_t_t_c_n_e_t' => new sfValidatorSchemaFilter('text', new sfValidatorNumber(array('required' => false))),
      'prix_t_v_a'             => new sfValidatorSchemaFilter('text', new sfValidatorNumber(array('required' => false))),
      'id_article'             => new sfValidatorDoctrineChoice(array('required' => false, 'model' => $this->getRelatedModelName('Article'), 'column' => 'id')),
      'id_article_serie'       => new sfValidatorDoctrineChoice(array('required' => false, 'model' => $this->getRelatedModelName('ArticleSerie'), 'column' => 'id')),
      'id_doc_entete'          => new sfValidatorDoctrineChoice(array('required' => false, 'model' => $this->getRelatedModelName('DocEnteteVersion'), 'column' => 'id')),
      'id_t_v_a'               => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
      'id_maintenance'         => new sfValidatorDoctrineChoice(array('required' => false, 'model' => $this->getRelatedModelName('Maintenance'), 'column' => 'id')),
      'id_departement'         => new sfValidatorDoctrineChoice(array('required' => false, 'model' => $this->getRelatedModelName('Departement'), 'column' => 'id')),
      'id_unite_logistique'    => new sfValidatorDoctrineChoice(array('required' => false, 'model' => $this->getRelatedModelName('UniteLogistique'), 'column' => 'id')),
      'created_at'             => new sfValidatorDateRange(array('required' => false, 'from_date' => new sfValidatorDateTime(array('required' => false, 'datetime_output' => 'Y-m-d 00:00:00')), 'to_date' => new sfValidatorDateTime(array('required' => false, 'datetime_output' => 'Y-m-d 23:59:59')))),
      'updated_at'             => new sfValidatorDateRange(array('required' => false, 'from_date' => new sfValidatorDateTime(array('required' => false, 'datetime_output' => 'Y-m-d 00:00:00')), 'to_date' => new sfValidatorDateTime(array('required' => false, 'datetime_output' => 'Y-m-d 23:59:59')))),
    ));

    $this->widgetSchema->setNameFormat('doc_ligne_version_filters[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    $this->setupInheritance();

    parent::setup();
  }

  public function getModelName()
  {
    return 'DocLigneVersion';
  }

  public function getFields()
  {
    return array(
      'id'                     => 'Number',
      'date'                   => 'Date',
      'designation'            => 'Text',
      'taux_remise'            => 'Number',
      'quantite_livre'         => 'Number',
      'quantite'               => 'Number',
      'poids_net'              => 'Number',
      'poids_brut'             => 'Number',
      'prix_unitaire_h_t'      => 'Number',
      'prix_total_h_t'         => 'Number',
      'prix_total_t_t_c'       => 'Number',
      'prix_total_t_t_c_n_e_t' => 'Number',
      'prix_t_v_a'             => 'Number',
      'id_article'             => 'ForeignKey',
      'id_article_serie'       => 'ForeignKey',
      'id_doc_entete'          => 'ForeignKey',
      'id_t_v_a'               => 'Number',
      'id_maintenance'         => 'ForeignKey',
      'id_departement'         => 'ForeignKey',
      'id_unite_logistique'    => 'ForeignKey',
      'created_at'             => 'Date',
      'updated_at'             => 'Date',
    );
  }
}
